/**
 * This file is released under the GNU General Public License.
 * Refer to the COPYING file distributed with this package.
 *
 * Copyright (c) 2008-2009 WURFL-Pro srl
 */
package net.sourceforge.wurfl.core;

import net.sourceforge.wurfl.core.resource.ModelDevice;
import net.sourceforge.wurfl.core.resource.WURFLModel;

import org.apache.commons.lang.Validate;

/**
 * {@link CapabilitiesHolderFactory} default implementation
 * <p>
 * Build instances of {@link DefaultCapabilitiesHolder}.
 * </p>
 * 
 * @author WURFL-PRO SRL, Rome, Italy
 * @version $Id: DefaultCapabilitiesHolderFactory.java 1045 2009-03-09 15:52:53Z filippo.deluca $
 */
public class DefaultCapabilitiesHolderFactory extends
		AbstractCapabilitiesHolderFactory {

	/**
	 * Build DefaultCapabilitiesHolderFactory by WURFL model.
	 * 
	 * @param model
	 *            The WURFLModel used by this DefaultCapabilitiesHolderFactory.
	 */
	public DefaultCapabilitiesHolderFactory(WURFLModel model) {
		super(model);
	}

	/**
	 * {@inheritDoc}
	 */
	public CapabilitiesHolder create(ModelDevice modelDevice) {

		Validate.notNull(modelDevice, "modelDevice is null");

		return new DefaultCapabilitiesHolder(new DefaultCapabilitiesLoader(
				modelDevice, model));
	}

}
